package cz.muni.fi.pa165.sportclubmanager.dao;

import cz.muni.fi.pa165.sportclubmanager.entity.AgeCategory;
import cz.muni.fi.pa165.sportclubmanager.entity.Team;
import java.util.List;

/**
 * 
 * @author Michal Prokeš, 72758
 */
public interface TeamDAO {

    /**
     * Add new team to DB.
     * @param t Team to create
     * @throws IllegalArgumentException if t is null or name or agecategory is not set or name is longer than 255 chars
     */
    public void create(Team t);

    /**
     * Update existing team in DB
     * @param t Team to update
     * @throws IllegalArgumentException if t is null name or agecategory is not set or name is longer than 255 chars
     */
    public void update(Team t);

    /**
     * Remove team from DB
     * @param t Existing team to remove
     * @throws IllegalArgumentException if t is null
     */
    public void remove(Team t);

    /**
     * Find team in DB by Id
     * @param id Id of searched team
     * @return searched team or null
     */
    public Team find(Long id);

    /**
     * List all teams in system
     * @return all teams in system
     */
    public List<Team> findAll();
    
    /**
     * List all teams belongings to defined ageCategory
     * @param ageCategory
     * @return all teams belonging to ageCategory
     * @throws IllegalArgumentException if ageCategory is null
     */
    public List<Team> findByAgeCategory(AgeCategory ageCategory);
}